/* Copyright Thanh-Trung Pham, JAIST, 2012 */

package jp.ac.jaist.model;

import java.util.ArrayList;
import java.util.List;

/**
 *
 * @author Thanh-Trung Pham
 */
public class RMExecutionState {

    private int m_iID;
    private double m_dNmep;
    private double m_dPfp;
    private double m_dSep;
    private double m_dSfp;
    private List<RMExecutionTransition> m_oIncomingTransitions;
    private List<RMExecutionTransition> m_oOutgoingTransitions;

    /**
     * The constructor.
     */
    public RMExecutionState() {
        m_iID = -1;

        m_dSfp = 0;
        m_dPfp = 0;
        m_dSep = 0;
        m_dNmep = 1;

        m_oIncomingTransitions = new ArrayList<RMExecutionTransition>();
        m_oOutgoingTransitions = new ArrayList<RMExecutionTransition>();
    }

    /**
     * Set the state ID.
     * @param id the state ID.
     */
    public void setID(int id) {
        m_iID = id;
    }

    /**
     * Update the state with new information.
     * @param sfp the sfp.
     * @param pfp the pfp.
     * @param sep the sep.
     * @param nmep the nmep.
     */
    public void updateStateInformation(double sfp, double pfp, double sep, double nmep) {
        m_dSfp = sfp;
        m_dPfp = pfp;
        m_dSep = sep;
        m_dNmep = nmep;
    }

    /**
     * Add an incoming transition.
     * @param transition the incoming transition.
     */
    public void addIncommingTransition(RMExecutionTransition transition) {
        m_oIncomingTransitions.add(transition);
    }

    /**
     * Add an outgoing transition
     * @param transition the outgoing transition.
     */
    public void addOutgoingTransition(RMExecutionTransition transition) {
        m_oOutgoingTransitions.add(transition);
    }

    /**
     * Get all the incoming transitions.
     * @return all the incoming transitions.
     */
    public List<RMExecutionTransition> getIncomingTransitions() {
        return m_oIncomingTransitions;
    }

    /**
     * Get all the outgoing transitions.
     * @return all the outgoing transitions.
     */
    public List<RMExecutionTransition> getOutgoingTransitions() {
        return m_oOutgoingTransitions;
    }

    /**
     * Get the state ID.
     * @return the state ID.
     */
    public int getID() {
        return m_iID;
    }

    /**
     * Get the nmep.
     * @return the nmep.
     */
    public double getNmep() {
        return m_dNmep;
    }

    /**
     * Get the pfp.
     * @return the pfp.
     */
    public double getPfp() {
        return m_dPfp;
    }

    /**
     * Get the sep.
     * @return the sep.
     */
    public double getSep() {
        return m_dSep;
    }

    /**
     * Get the sfp.
     * @return the sfp.
     */
    public double getSfp() {
        return m_dSfp;
    }
}
